Draws text in world space with the line curving away from you, as if it were wrapped round a barrel or a sign tipped back - the top and bottom of the letters shrink back and the middle stays full size. shape picks the look: TEXT_BULGE, TEXT_LEAN_BACK and TEXT_LEAN_FORWARD choose which part of the line shrinks, and TEXT_DRUM is different - it fixes a lens on the middle of the screen and the words slide through it (see TEXT_DRUM). TEXT_BAND is a lens fixed on the screen too, but a narrow 64-row band, the shape of the WARNING word in a boss introduction (see TEXT_BAND). depth says how much, up to 6: 1 is gentle, 3 is deep, and 4, 5 and 6 are far deeper, down to a thin sliver at the far edge of the letters, and want a big, bold font. (x, y) is the same LEFT/CENTER/RIGHT anchor draw_text already uses. Inside a Draw GUI event it is fixed to the screen instead, and (x, y) counts from the screen’s top-left pixel - a title or banner that stays put when the camera moves.
Works differently on Game Boy - The Game Boy cannot squeeze letters row by row: a short 3D text gets a copy behind it, TEXT_BULGE arches the line, TEXT_DRUM and TEXT_BAND show it only inside their lens (24 letters at most, drawn with sprites).
Works differently on Game Boy Color - The Game Boy Color cannot squeeze letters row by row: a short 3D text gets a copy behind it, TEXT_BULGE arches the line, TEXT_DRUM and TEXT_BAND show it only inside their lens (24 letters at most, drawn with sprites).
Sega Genesis: not available
On other consoles this differs: see Side by side and How the consoles differ.
draw_text_3d(x, y, text, shape, depth)| Name | Type |
|---|---|
x | real |
y | real |
text | string |
shape | text_shape |
depth | int |
Nothing.
Draws text that curves away from you, so a flat line of letters looks like it is wrapped round a barrel or stuck on a sign that is tipped back. The letters near the top or bottom of the line shrink back, and the ones in the middle stay big. It is draw_text with a third dimension.


The top line is draw_text_3d at depth 5; the line under it is the same words with plain draw_text. Both are real pictures from a Game Boy Advance ROM. The letters come from a bold 32 pixel font, because a deep curve shows best on big, fat letters - the paragraphs about depth say why.
(x, y) is a place in the room, counted from the room's top-left corner (in a Draw GUI event the call is fixed to the screen instead, and (x, y) counts from the screen's top-left pixel - a title or banner that stays put when the camera moves), and it means the same thing it means for draw_text: text_align decides whether it is the left end, the middle or the right end of the line, and y is the middle of the line from top to bottom. The text uses the same font_set font as every other text call, and it is cached the same way, so call it every frame it should stay on screen and let it go when you stop.
shape says which part of the line shrinks away:
TEXT_BULGE - the middle stays big, the top and the bottom both shrink. Like text on a barrel.TEXT_LEAN_BACK - the bottom stays big, the top shrinks. Like a sign tipped back, so the top edge is farther from you.TEXT_LEAN_FORWARD - the top stays big, the bottom shrinks.TEXT_DRUM - not a curve on the text at all: a lens in the middle of the screen, and the words slide through it. See its own page.

The three curves, one under the other, all at depth 5.
depth says how much, as a whole number from 0 to 6. A number past that range is held to the nearest end. 0 draws the plain flat text and costs nothing - which makes it easy to switch the effect on and off with a variable.


The same bulge at every depth, from the flat line at the top down to depth 6. Look at the top and bottom of the letters.


The same seven pictures played in a loop (a browser plays it; a viewer that does not shows the flat line).
Depths 4 to 6 want a big, bold font. When a row of letters is drawn at a quarter of its width, the console reads the font's picture four columns at a time, and a line that is only one pixel thick can fall between the columns it reads and vanish - the bar across an E goes first. A bold font (strokes four or five pixels thick, like the 32 pixel one in the pictures) is still perfectly readable at a quarter of its width. A thin font is not. So the engine only draws the deep depths for a font drawn from 32 pixel tall pictures, and holds a smaller one - the 8 or 16 pixel fonts - to depth 3 instead, rather than draw letters you cannot read. When that happens a development build says so once in its log, naming the call. If you want a deep curve, give the font its own 32 pixel bold face (the font_set page says how fonts are made).
Deeper is also not always better on a font that is bold enough: the deepest curves make a line smaller overall, because every row of it is narrower. Try depth 5 before depth 6.
The shrinking is real, not a trick of the font. Every row of the screen is drawn at its own size. For depths 1 to 3 the rows that shrink most are also pulled closer together, so the line comes out a little shorter than the flat text; at depths 4 to 6 only the width of a row follows the curve and the letters keep nearly all of their height, which is why they look so much more like a real tilted sign. A line is never taller than the flat text. For a font taller than 32 pixels the top and bottom of the letters are cut off. The curve follows the text up and down the screen to the nearest two rows.
One more thing to know before you pick a deep curve. The console draws a line of text as small pictures a few letters wide (two letters each, for a 16-pixel font), and every picture shrinks toward its own middle - not toward the middle of the whole line. So where the letters are drawn narrow, each little group gets narrower on its own and a gap opens between the groups: TIPPED BACK leaning back at depth 3 on a 16 pixel font reads as TI PP ED BA CK. A big font draws one letter to a picture, so the gaps fall between letters and look natural: that is the other reason the deep curves are for big fonts.
A line of 3D text is drawn at the font's own size, and it cannot be turned. To make it bigger, smaller or flipped, use draw_text_3d_scaled (it takes the same numbers and two more, xscale and yscale). To turn text, use draw_text_warped, which has no curve. To lean the whole line like italic writing, use draw_text_3d_sheared. A picture can curve too: see draw_sprite_3d.
The curve is made for a single line of text. A "\n" in the string ends the text there: only the first line is drawn, and what follows is left out. To curve several lines, draw each with its own call.
The Game Boy Advance can only do this much of it at once, and it matters, so here is the full bill. One line of 3D text uses one of the 32 matrices (the same kind draw_text_warped uses) and two of the 8 row-by-row effects the console has. A room change keeps two of those eight for itself, so there are six left for you: three 3D things at once (a 3D sprite from draw_sprite_3d costs exactly what a 3D text does), or two 3D things and two rippling sprites, or one 3D thing and four rippling sprites, or six rippling sprites. A sky from screen_backdrop takes one of the six too, and the game counts them all together. See draw_sprite_ripple for the other half. A scaled line from draw_text_3d_scaled costs the same and 640 bytes of memory more.
Depths 1 to 3 use tables that are kept in the cartridge. Depths 4 to 6 and TEXT_DRUM have no tables in the cartridge at all: the engine works one out in memory the first time a text asks for it (measured on a ROM: a little over an eighth of one frame, once), keeps it for as long as any text is using it, and lets two texts that ask for the same one share it. So the deep depths cost no cartridge space, and a game that never uses them carries nothing but a little code. Changing a text's depth back and forth is cheap for the same reason, as long as no more than three different curves are on the screen at once; a curve the game has not used for a while is worked out again, and that is the little over an eighth of a frame again.
Ask for more than there is and the game stops, in a development build, with a message that names every call that is holding a slot - they are numbered from 0 in the order they are written in an object's event, and a 3D text is named by its first letters. The text has already been drawn flat when it stops, and a release build, which has no such stop, simply shows it flat. The effect never fails to appear: you are told.
What else fits on the same rows. The console has about 1,210 cycles to draw the sprites on each row of the screen, and a 3D line uses very little of that: each letter is one sprite that costs about 10 plus twice its width, so a line of seven letters in a 16 pixel font is about 294 on the rows it covers, and twelve letters (the most one call holds) about 504. Words, sprites and another line of text drawn beside or across the same rows are drawn as usual - measured on a real ROM with a word in the middle and words to the left and right of it and above and below. What can use up the rest of a row is a wide stretched bar: see draw_rect_fill. If a bar next to a 3D word comes out with a piece missing, count the bars on those rows before blaming the word.
text_align(ALIGN_CENTER);
draw_text_3d(x, y - 24, "GET READY", TEXT_BULGE, 5);A title, centered above this instance, pinched at the top and bottom of every letter like a barrel seen close up. It needs a bold 32 pixel font to read well at depth 5.
var tilt = 0;
if (btn_held(BTN_A)) { tilt = 3; }
draw_text_3d(x, y, "TIPPED", TEXT_LEAN_BACK, tilt);A word that leans back only while A is held. With tilt at 0 it is the plain flat text and the effect costs nothing; the moment it becomes 3 the top of the letters sweeps away from you.
text_align(ALIGN_CENTER);
draw_text_3d(120, 80 + wave(-30, 30, 120, 0), "STAGE 2", TEXT_DRUM, 3);A word that slides up and down the middle of the screen through a lens, getting smaller as it nears the top or the bottom of it. See TEXT_DRUM.
Costs ONE of the hardware’s 32 affine matrices and TWO of the console’s 8 row-by-row (H-Blank) effects, for as long as the call keeps being made. Every letter gets a sprite of its own, so every letter leans by exactly what its own row asks and a word never leans in clumps. That holds for a word of up to 12 letters (spaces do not count). A longer word is still drawn, but its letters share sprites, up to four to a sprite, so it leans in clumps of letters; a development build says so once in the log, and drawing a long line as two calls keeps it even. Each letter counts toward the 128 sprites the screen can show at once, so a 12-letter word costs 12 where the same word in draw_text costs 3. A room transition keeps two of the eight for itself, so at most three 3D things (texts, or sprites from draw_sprite_3d, which cost the same) can be on screen at once, and a rippling sprite takes one of the same six. Asking for more than there is stops the game with a message that names every call holding a slot (the plain text has already been drawn when it stops, and a release build, which has no such stop, simply draws it flat). depth 0 draws plain text and costs nothing, and a depth above 6 is treated as 6. Fonts up to 32 pixels tall are fitted; a taller one is cut off at the top and bottom. The curve follows the text to the nearest two rows. Depths 4 to 6 need a font drawn from sprites 32 pixels tall: a smaller font cannot do them, so its text is drawn at depth 3 instead, and a development build says so once in the log. Depths 4 to 6 are worked out in memory the first time a text asks for them, so they take no cartridge space. With TEXT_DRUM the lens belongs to the screen, not to the text, so the curve does not follow the word: a word whose middle is outside the lens is not drawn at all, and depth is how tight the lens is. It is drawn at the font’s own size and cannot be turned: use draw_text_3d_scaled to make it bigger, smaller or flipped, and draw_text_warped to turn text (without the curve).